/*
 *
 * 名称：五行
 * 功能：五行功能实现
 * 作者：清河张
 * 时间：2025.05.11
 *
 */


#include "wuxing.h"
#include <cstdio>


WUXING_T::WUXING_T():
    CT(WX__, " "), _x4(XIANG4::X4_____), _yinname(" "), _yunname(" ")
{

}

WUXING_T::WUXING_T(int id, int x4, const char *name, const char* yin, const char* yun):
    CT(id, name), _x4(x4), _yinname(yin), _yunname(yun)
{

}

XIANG4 WUXING_T::x4() const
{
    return _x4;
}

const char *WUXING_T::yinname() const
{
    return _yinname;
}

const char *WUXING_T::yunname() const
{
    return _yunname;
}


template<> WUXING5::WXXQF_T WUXING5::WXXQF::_objs[5] =
{
    {0,"相"},
    {1,"旺"},
    {2,"休"},
    {3,"囚"},
    {4,"废"}
};

WUXING5::WXXQF_T::WXXQF_T(): CT(-1,"")
{

}

WUXING5::WXXQF_T::WXXQF_T(int id, const char *name) : CT (id,name)
{

}

template<> WUXING5::WXXQS_T WUXING5::WXXQS::_objs[5] =
{
    {0,"旺"},
    {1,"休"},
    {2,"囚"},
    {3,"死"},
    {4,"相"}
};

WUXING5::WXXQS_T::WXXQS_T(): CT (-1,"")
{

}


WUXING5::WXXQS_T::WXXQS_T(int id, const char *name) : CT (id,name)
{

}

template<> WUXING5::SHENGKE_T WUXING5::SHENGKE::_objs[5] =
{
    {0,"帮"},
    {1,"泄"},
    {2,"耗"},
    {3,"克"},
    {4,"生"}
};

WUXING5::SHENGKE_T::SHENGKE_T():CT(-1,"")
{

}

WUXING5::SHENGKE_T::SHENGKE_T(int id, const char *name) : CT (id,name)
{

}

template<> WUXING_T ZHOUQI<WUXING_T, 5>::_objs[5] =
{
    {WUXING_T::MUUU, XIANG4::SHHYANG, "木", "角", "风"},//"肝", "胆囊", WX5_CEXT::RGBA{0x00,0xff,0x00,0x00}
    {WUXING_T::HUOO, XIANG4::TAIYANG, "火", "徴", "火"},//"心", "小肠", WX5_CEXT::RGBA{0xff,0x00,0x00,0x00}
    {WUXING_T::TUUU, XIANG4::X4_____, "土", "宫", "湿"},//"脾", "胃囊", WX5_CEXT::RGBA{0xff,0xff,0x00,0x00}
    {WUXING_T::JINN, XIANG4::SHAOYIN, "金", "商", "燥"},//"肺", "大肠", WX5_CEXT::RGBA{0xf0,0xf0,0xf0,0x00}
    {WUXING_T::SHUI, XIANG4::TAIYINN, "水", "羽", "寒"},//"肾", "膀胱", WX5_CEXT::RGBA{0x0f,0x0f,0x0f,0x00}
};

WUXING5::WUXING5():
    ZHOUQI<WUXING_T, 5>(-1)
{

}

WUXING5::WUXING5(int id):
    ZHOUQI<WUXING_T, 5>(id)
{

}

WUXING5::WUXING5(const ZHOUQI<WUXING_T, 5> &parent):
    ZHOUQI<WUXING_T, 5> (parent)
{

}

WUXING5::SHENGKE WUXING5::shengke(WUXING5 wx) const
{
    return wx - *this;
}

WUXING5::WXXQS WUXING5::wxxqs(WUXING5 wx) const
{
    return wx - *this;
}

WUXING5::WXXQF WUXING5::wxxqf(WUXING5 wx) const
{
    return wx - *this;
}



WUXINGX2::WUXINGX2(const WUXING_T wx1, const WUXING_T wx2):
    _wx1(wx1), _wx12(wx2)
{
    std::snprintf(_name, sizeof(_name), "%s%s", wx1.name(), wx2.name());
}

const char *WUXINGX2::name() const
{
    return _name;
}
